<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.Map"%>
<%@ page import="java.util.List"%>
<%@ page import="org.limp.mine.Label"%>
<%@ page import="org.limp.mine.StringTool"%>
<%@ page import="org.limp.mine.Controller"%>

<%
	String context = jt.classic.system.ISystem.getContextPath();
	Object[] result = (Object[]) request.getAttribute("result");
	Label label = (Label) result[1];
	Controller controller = (Controller) result[2];
	String pageNO = (String) result[3];
	List resultList = (List) result[0];
	
	String catid = StringTool.checkString(request.getAttribute("catid"));
	String qname = StringTool.checkString(request.getAttribute("qname"));
	Map cat = (Map)request.getAttribute("cat");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<jsp:include page="../head.jsp"></jsp:include>
<head>
<title>个人通讯录列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<script>
var context = "<%=context%>";
var catid = "<%=catid%>";
var catname = "<%=(cat != null ? cat.get("CATNAME") : "") %>";
</script>
<link rel="stylesheet" type="text/css" href="<%=context%>/resources/ext3/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="<%=context%>/app/addressBook/css/addrBook.css" />
<!-- ExtJS library: base/adapter -->
<script type="text/javascript" src="<%=context%>/resources/ext3/adapter/ext/ext-base.js"></script>
<!-- ExtJS library: all widgets -->
<script type="text/javascript" src="<%=context%>/resources/ext3/ext-all.js"></script>
<!-- ExtJS language -->
<script type="text/javascript" src="<%=context%>/resources/ext3/locale/ext-lang-zh_CN.js"></script>
<script src="<%=context %>/app/addressBook/js/querylist.js"></script>
<script language="javascript"
	src="<%=context%>/resources/common/js/xmltool.js"></script>
<script>
     function sendMessage(name, tel){
         var url = '<%=context%>/app/addressBook/smsshort.jsp?phoneNum=' + tel + '&name=' + name;
         dialog(url, true, '短信发送窗口', 340, 250);
     }
</script>
<body>
<form name="form1" method="post" action="">
<input type="hidden" name="pageNO" value="<%=pageNO%>">
<input type="hidden" name="catid" value="<%=catid%>">
<table border="0" align="center" width="100%">
  <tr>
		<td colspan="6" align="left">联系人：
		<input type="text" style="width:100px;" name="qname" class="box4" value="<%=qname %>">
 <img src="/app/info/images/search.png" title="查询" style="cursor:hand;margin-bottom:-4px;" onclick="javascript:handleQuery();"/><a href="javascript:void(0);" onclick="javascript:handleQuery();">查 询</a>		
 <img src="/app/info/images/addinfo.png" title="新增" style="cursor:hand;margin-bottom:-4px;" onclick="javascript:handleInsert();"/><a href="javascript:void(0);" onclick="javascript:handleInsert('<%=catid %>', '<%=(cat != null ? cat.get("CATNAME") : "") %>');">新 建</a>
		<img src="<%=context %>/app/info/images/page_white_delete.png" title="删除联系人" style="cursor:hand;margin-bottom:-4px;" onclick="javascript:handleDelete();"/><a href="javascript:void(0);" onclick="javascript:handleDelete();">删 除</a>	
		</td>
	</tr>
</table>	
<table class="tbl" align="center" width="100%">
	<thead>
	<tr><td class="td1" title="全部选择/取消选择" onclick="javascript:checkall();"
			width="10" align="center">&nbsp;</td>
		<td class="td1" 
			width="20%" align="center">&nbsp;<font color="#4C4C4C">联系人姓名</font></td>
		<td class="td1" 
			width="15%" align="center">&nbsp;<font color="#4C4C4C">座机电话</font></td>
		<td class="td1" 
			width="15%" align="center">&nbsp;<font color="#4C4C4C">移动电话</font></td>
		<td class="td1" 
			width="15%" align="center">&nbsp;<font color="#4C4C4C">传真</font></td>	
		<td class="td1" 
			width="15%" align="center">&nbsp;<font color="#4C4C4C">email</font></td>			
		<td class="td1" 
			width="20%" align="center">&nbsp;</td>
	</tr>
	</thead>
	<%
			if (resultList != null && !resultList.isEmpty()) {
				
			for (int i = 0; i < resultList.size(); i++) {
				Map info = (Map) resultList.get(i);
				String number = (String) info.get("PAGINATION_NUMBER");
				String ID = (String) info.get("ID");
				String NAME = (String) info.get("NAME");
				String OFFICEPHONE = (String) info.get("OFFICEPHONE");
				String OFFICEFAX = (String) info.get("OFFICEFAX");
				String MOBILEPHONE = (String) info.get("MOBILEPHONE");
				String EMAIL = (String) info.get("EMAIL");
				String ADDRESS = (String) info.get("ADDRESS");
				
	%>
	<tr onMouseOver="javascript:this.bgColor='#ffff99'"
		onmouseout=" javascript:this.bgColor='#ffffff'" bgColor="#ffffff">
		<td align="center"><input type="checkbox" name="chk"
			value="<%=ID%>"></td>
		<td align="center"><a href="javascript:void(0);" onclick="javascript:handleEdit('<%=catid %>', '<%=(cat != null ? cat.get("CATNAME") : "") %>', '<%=ID %>');"><%=NAME%></a></td>
		<td align="center">&nbsp;<%=OFFICEPHONE%></td>
		<td align="center"><%=MOBILEPHONE%></td>
		<td align="center">&nbsp;<%=OFFICEFAX%></td>
		<td align="center">&nbsp;<%=EMAIL%></td>
		<td align="center">&nbsp;<%if(!MOBILEPHONE.equals("")) {%><a href="javascript:sendMessage('<%=NAME %>', '<%=MOBILEPHONE%>');">发短信</a><%} %></td>
	</tr>
	<%
		}
		}
	%>
</table>
<table width="100%" class="tab-noborder" align="center" border="0" cellspacing="0"
	cellpadding="0">
	<tr>
		<td><%=label.displayLabel()%></td>
		<td align="right"><%=label.startLabel()%> <%=label.previousLabel()%>
		<%=label.nextLabel()%> <%=label.endLabel()%> <%=controller.getController().toString()%>
		</td>
	</tr>
</table>
<%=controller.getControlScript(true)%></form>
</body>
</html>
